Skip to content

fix(bus): propagate provider to queue subscriptions#6860

Draft
barnesoir wants to merge 2 commits intoanomalyco:devfrom
barnesoir:fix-bus-queue-provider
Draft

fix(bus): propagate provider to queue subscriptions#6860
barnesoir wants to merge 2 commits intoanomalyco:devfrom
barnesoir:fix-bus-queue-provider

Conversation

@barnesoir
Copy link
Copy Markdown

When using subscribeQueue on a Bus created with a custom provider (cross-account scenario), the provider was not being passed to the underlying BusQueueSubscriber. This caused EventBridge rules and targets to be created in the wrong AWS account.

Changes:

  • Instance subscribeQueue() now passes { provider: this.constructorOpts.provider }
  • Static subscribeQueue() now accepts optional ComponentResourceOptions parameter
  • _subscribeQueue() accepts and passes opts to BusQueueSubscriber constructor

This ensures queue subscriptions respect the bus provider in cross-account setups.

@barnesoir barnesoir force-pushed the fix-bus-queue-provider branch from c88aa6c to 4f495e8 Compare May 6, 2026 16:01
The queue policy must use the IAM role ARN as the principal, not the
events.amazonaws.com service principal. When EventBridge assumes an IAM
role to send messages cross-account, the request comes from the role ARN.

Changes:
- Queue policy now uses targetRole.arn as the principal (type: AWS)
- This fixes cross-account EventBridge→SQS delivery

Tested: Events now successfully flow from EventBridge to SQS queue
@barnesoir barnesoir marked this pull request as draft May 6, 2026 16:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant